from django.db import models
from django.utils import timezone
# Create your models here.
class Item(models.Model):
    id = models.AutoField(primary_key=True, verbose_name="编号")
    number=models.IntegerField(verbose_name="展示序号",default=0)
    name = models.CharField(max_length=1024, verbose_name="名称")
    url = models.CharField(max_length=2048, verbose_name="访问地址",default='/')
    path = models.CharField(max_length=2048, verbose_name="真实地址")
    md5 = models.CharField(max_length=1024, verbose_name="md5值")
    func_type=models.CharField(max_length=1024, verbose_name="功能分类",default='lesson')
    item_type=models.CharField(max_length=1024, verbose_name="元素类别")
    lv=models.CharField(max_length=1024, verbose_name="级别",default=0)
    show=models.BooleanField(verbose_name="是否展示",default=True)
    modified_time = models.DateTimeField(verbose_name='更新时间',default=timezone.now)

    class Meta:
        verbose_name = "讲义or练习"
        verbose_name_plural = "讲义or练习"# 侧边栏

    def __str__(self):
        return str(self.name)